cd "$replication\code\"

set matsize 5000

****************************************************************************** Input variables ************************************************************
global cluster "sd_code"
global AS_infs `""""'
global AS_var "NA"
global sample "year!=."
global controls ""
global controlsXYFEs ""
global controlsXinfs ""
global omitted_year1=-1
global omitted_year2=-6
global min_year=-6
global max_year=5
global colour="no_graphs"
global depvar "icw_irrigation"

global int "elecXroad"
local inf1=substr("${int}",1,4)
local inf2=substr("${int}",6,.)
global  infs "`inf1' `inf2' ${int}"
global absorb "shrid_code i.s_code#i.year"



qui use  "${replication}\data\for_event.dta", clear

levels s_code

global states `"`r(levels)'"'

foreach state in $states {
	disp "state `state'"
	global sample "s_code!=`state'"
	qui: do Z_Event_code.do
	qui: estimates restore post_elecXroad
	qui: estimates store no_state_`state'
}




global plotlist ""
foreach state in $states {
	if `state' == 1  local state_name "Jammu and Kashmir"
if `state' == 2  local state_name "Himachal Pradesh"
if `state' == 3  local state_name "Punjab"
if `state' == 4  local state_name "Chandigarh"
if `state' == 5  local state_name "Uttaranchal"
if `state' == 6  local state_name "Haryana"
if `state' == 7  local state_name "Delhi"
if `state' == 8  local state_name "Rajasthan"
if `state' == 9  local state_name "Uttar Pradesh"
if `state' == 10 local state_name "Bihar"
if `state' == 11 local state_name "Sikkim"
if `state' == 12 local state_name "Arunachal Pradesh"
if `state' == 13 local state_name "Nagaland"
if `state' == 14 local state_name "Manipur"
if `state' == 15 local state_name "Mizoram"
if `state' == 16 local state_name "Tripura"
if `state' == 17 local state_name "Meghalaya"
if `state' == 18 local state_name "Assam"
if `state' == 19 local state_name "West Bengal"
if `state' == 20 local state_name "Jharkhand"
if `state' == 21 local state_name "Orissa"
if `state' == 22 local state_name "Chhattisgarh"
if `state' == 23 local state_name "Madhya Pradesh"
if `state' == 24 local state_name "Gujarat"
if `state' == 25 local state_name "Daman & Diu"
if `state' == 26 local state_name "Dadra & Nagar Haveli"
if `state' == 27 local state_name "Maharashtra"
if `state' == 28 local state_name "Andhra Pradesh"
if `state' == 29 local state_name "Karnataka"
	global plotlist "$plotlist (no_state_`state', rename((1) = "`state_name'"))"
}


global sample "inlist(s_code,28,22,23,2,8,5)==0"
qui: do Z_Event_code.do
qui: estimates restore post_elecXroad
qui: estimates store no_star_states

global plotlist "$plotlist (no_star_states, rename((1) = "NREGA star states"))"



local colour purple

coefplot $plotlist, xline(0) nokey xscale(range(0 (.01) .12)) xlabel(0 (.02) .12) xtitle(" " "Coefficient on Electricity and Road interaction")   graphregion(color(white))  mcolor(`colour'*1.5) ciopts(lcolor(`colour'*2)) relocate("NREGA star states" = 23)
graph export "${dropbox}\India interactions\6_replication_files\Output\excluding_states.png", replace